<% @title = 'Search'%>
<h2>搜索网络ID</h2>
    
<%= start_form_tag :action => "search" %>
   <label for="webid">网络ID:</label>
   <%= text_field_tag "webid" %><br />
   <label for="sites">站点:</label>
   <%= select_tag "sites", '<option value="-1">所有站点</option>' + options_from_collection_for_select(@sites, :id, :name)%><br />
   <label></label>
   <%= submit_tag "搜索", :id => 'search' %>
<%= end_form_tag %>

<div id="search_result">
	<% unless @results.nil?%>
		<table id="identities">
		<% @results.each do |identity|%>
		<tr>
			<td><%=link_to identity.user.username, public_id_url(:username => identity.user.username)%></td>
			<td><%=h identity.site.name%></td>
			<td><%=h identity.name%></td>
		</tr>
		<% end %>
		</table>
	<% end%>
</div>
